package cn.lhf.cd.controller;

import cn.lhf.cd.FXApplication;
import cn.lhf.cd.annotation.FXController;

import java.net.URL;
import java.util.ResourceBundle;

@FXController(path = "/ui/home.fxml")
public class HomeController extends ChildrenController {

    @Override
    public String getTitle() {
        return "主窗口";
    }

    @Override
    public void initialize(URL location, ResourceBundle resources) {

    }

    @Override
    public void onBtnLeft1() throws Exception {
        getMainController().setFrameView(WithdrawalController.class);
    }

    @Override
    public void onBtnLeft2() throws Exception {
        getMainController().setFrameView(PlusController.class);
    }

    @Override
    public void onBtnLeft3() throws Exception {
        getMainController().setFrameView(TransferController.class);
    }

    @Override
    public void onBtnRight1() throws Exception {
        getMainController().setFrameView(CheckBalanceController.class);
    }

    @Override
    public void onBtnRight2() throws Exception {
        getMainController().setFrameView(ChangePasswordController.class);
    }

    @Override
    public void onBtnRight3() throws Exception {
        getMainController().setFrameView(HistoryController.class);
    }

    @Override
    public void onBtnRight4() {
        FXApplication.close();
    }
}
